export const GET_CATEGORIES = 'GET_CATEGORIES' //获取商品类别


export default {
    state: {
        obj: JSON.parse(window.localStorage.getItem('categories')) || []
    },
    mutations: {
        [GET_CATEGORIES](state, data) {
            state.obj = data;
            window.localStorage.setItem('categories', JSON.stringify(data))
        }
    } ,
    actions: {
        [GET_CATEGORIES]({commit}, data) {
            commit(GET_CATEGORIES, data)
        }
    }
}